<ion-header>
  <ion-toolbar>
    <ion-searchbar placeholder="商品名" [debounce]="250"> </ion-searchbar>
  </ion-toolbar>
</ion-header>

<ion-content *ngIf="res">
  <ion-refresher
    slot="fixed"
    (ionRefresh)="doRefresh($event)"
    pullFactor="0.8"
    pullMin="60"
    pullMax="120"
  >
    <ion-refresher-content></ion-refresher-content>
  </ion-refresher>

  <ion-card>
    <ion-item
      detail
      button
      *ngFor="let item of res.data;let i=index"
      [routerLink]="['/detail',{lid:item.lid}]"
    >
      <img
        [src]="'http://101.96.128.94:9999/'+item.pic"
        alt=""
        style="width: 100px; height: 100px"
      />
      <ion-label>
        <h2 style="margin-bottom: 30px">{{item.title}}</h2>
        <p style="color: red; font-size: 1.2em">￥{{item.price}}</p>
      </ion-label>
    </ion-item>
  </ion-card>
  <ion-infinite-scroll
    threshold="25%"
    [disabled]="res.pageCount==res.pno"
    position="bottom"
    (ionInfinite)="loadData($event)"
  >
    <ion-infinite-scroll-content
      loadingSpinner="bubbles"
      loadingText="加载中..."
    >
    </ion-infinite-scroll-content>
  </ion-infinite-scroll>
  <div
    style="text-align: center; padding: 10px; color: lightpink"
    [hidden]="res.pageCount!=res.pno"
  >
    没有更多数据了
  </div>
</ion-content>
